﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace MyLibellus
{
    public partial class GestioSubject : Form
    {
        private Subject s;
       
        private bool aceptar;

        public GestioSubject()
        {
            InitializeComponent();
        }

        private void GestioSubject_Load(object sender, EventArgs e)
        {
            if (s != null)
            {
                txtSubject.Enabled = true;
                txtSubject.Text = s.Nom;
                

            }
            else
            {
                s = new Subject();

                txtSubject.Text = "";
                txtSubject.Enabled = true;
                txtSubject.Focus();
            }

        }

        private void btnCancelarGestAuthor_Click(object sender, EventArgs e)
        {
            Close();
            this.aceptar = false;
            this.s = null;
        }
        
        public Subject S
        {
            get { return s; }
            set { s = value; }
        }

        public bool Aceptar
        {
            get { return aceptar; }
            set { aceptar = value; }
        }

        private void btnAceptarGestAuthor_Click(object sender, EventArgs e)
        {
            this.Close();
            this.aceptar = true;
            s = new Subject();
            s.Nom= txtSubject.Text;
        }

       
    }
}
